<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<style>
		* {
			padding: 0px;
			margin: 0px;
		}
		body {
			display: flex;
			align-items: center;
			align-content: center;
			justify-content: space-around;
			margin-top: 40px;
		}
		.container {
			width: 660px;
			height: 940px;
			border: 1px solid black;
			/* transform: translate(-50%); */
		}
		.container .anniu {
			width: 270px;
			height: 400px;
			border: 1px solid red;
			margin-left: 10px;
			margin-top: 10px;
			background-image: url(./light-switch.png);
			background-repeat: no-repeat;
			background-size: 540px 400px;
		}

		.container .dengpao {
			width: 240px;
			height: 260px;
			border: 1px solid green;
			margin: 30px auto;
			background-image: url(./lightbulb.png);
			background-repeat: no-repeat;
			background-size: 500px 260px;
		}

		.container .anniu:hover {
			background-position: -270px;
		}

		.container .anniu:hover ~ .dengpao {
			background-position: -250px;
		}
	</style>
	<body>
		<div>背景使用position自动帮我们处理溢出</div>
		<div class="container">
			<div class="anniu"></div>
			<div class="dengpao"></div>
		</div>
	</body>
</html>
